package com.authService.convert;
import com.authService.entity.SysPermissionEntity;
import com.authService.pojo.req.PermissionEditReqDTO;
import com.authService.pojo.res.PermissionDetailResDTO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers;

@Mapper
public interface PermissionConvert {

    public static final PermissionConvert INSTANCE = Mappers.getMapper(PermissionConvert.class);

    /**
     * 详情响应体 Entity 转 DTO
     * @param sysMenuEntity
     * @return
     */
    @Mappings({
            @Mapping(target = "permissionId", source = "id")
    })
    PermissionDetailResDTO detailConvert(SysPermissionEntity sysMenuEntity);


    /**
     * 保存请求参数 DTO 转 Entity
     * @param reqDTO
     * @return
     */
    SysPermissionEntity editReqDTOConvert(PermissionEditReqDTO reqDTO);

}
